Function Reference

_GUICtrlComboLimitText

Limit the length of the text the user may type into the edit control of a combo box

#Include <GuiCombo.au3>
_GUICtrlComboLimitText($h_combobox[, $i_limit=0])

 

Parameters

$h_combobox control id/control hWnd
$i_limit Optional: Specifies the maximum number of characters the user can enter

 

Return Value

None.

 

Remarks

If the $i_limit parameter is zero, the text length is limited to 0x7FFFFFFE characters.

If the combo box does not have the $CBS_AUTOHSCROLL style, setting the text limit to
be larger than the size of the edit control has no effect.

The $CB_LIMITTEXT message limits only the text the user can enter.

It has no effect on any text already in the edit control when the message is sent,
nor does it affect the length of the text copied to the edit control when a string
in the list box is selected.

The default limit to the text a user can enter in the edit control is 30,000 characters

 

Related

None.

 

Example


#include <GuiConstants.au3>
#include <GuiCombo.au3>

Opt('MustDeclareVars',1)

Dim $Combo,$Btn_Exit,$msg

GuiCreate("ComboBox Limit Text", 392, 254)

$Combo = GuiCtrlCreateCombo("", 70, 100, 270, 100,$CBS_SIMPLE)
GUICtrlSetData($Combo,"A|B|C|D|E|F")
_GUICtrlComboLimitText($Combo,10)
$Btn_Exit = GuiCtrlCreateButton("Exit", 150, 200, 90, 30)

GuiSetState()
While 1
    $msg = GuiGetMsg()
    Select
        Case $msg = $GUI_EVENT_CLOSE Or $msg = $Btn_Exit
            ExitLoop
    EndSelect
WEnd
Exit